package org.acsis.jee.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ClassLoaderUtil {

	public static InputStream getPropertyRessource(String name){
		return Thread.currentThread().getContextClassLoader().getResourceAsStream(name + ".properties");
	}
	
	public static Properties loadProperties(String name){
		
		Properties props = new Properties();
		
		try {
			props.load(getPropertyRessource(name));
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
			return null;
		} catch (IOException e1) {
			e1.printStackTrace();
			return null;
		}
		
		return props;
	}
}
